import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

public class Test22 {
    public static void main(String[] args) {
        /*Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();

        int count = 0;
        while (true) {
            String s = sc.nextLine();

            //当按回车键没有录入到内容时，录入为空，str.equals("") true ,把这个作为结束条件
            if (s.equals("")) {
                break;
            }

            if (s.length() > 50) {
                System.out.println("单行长度不能超50字符，请重新录入");
                continue;
            }

            sb.append(s + " ");
            count++;
            if (count >= 50) {
                break;
            }

        }

        String str = sb.toString();
        String[] strArr = str.split(" ");

        HashSet<String> hashSet = new HashSet<>();
        for (String s : strArr) {
            hashSet.add(s);
        }

        System.out.println(hashSet.size());*/




            //下厨房


                Scanner in = new Scanner(System.in);
                HashSet<String> set = new HashSet<String>();

                while(in.hasNext()){
                    String str = in.nextLine();
                    String arr[] = str.split(" ");
                    for(int i=0; i<arr.length; i++){
                        set.add(arr[i]);
                    }
                }

                System.out.println(set.size());
                set.clear();


    }
}
